//
//  CCDiscoverViewController.swift
//  SinaWebo
//
//  Created by 陶建 on 16/3/24.
//  Copyright © 2016年 taoJ. All rights reserved.
//

import UIKit

class CCDiscoverTableViewController: CCBasicViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        if !isLoginFlag {
            navigationItem.leftBarButtonItem = registerLeftBarButtonItem
            navigationItem.rightBarButtonItem = loginRightBarButtonItem
        }
    }
    
    private lazy var registerLeftBarButtonItem: UIBarButtonItem = {
        let registerLeftBarButtonItem = UIBarButtonItem(title: "注册", style: .Plain, target: self, action: #selector(CCHomeTableViewController.tapRegisterItem))
        
        return registerLeftBarButtonItem
    }()
    
    func tapRegisterItem() {
        print("tapRegisterItem")
    }
    
    private lazy var loginRightBarButtonItem: UIBarButtonItem = {
        let loginRightBarButtonItem = UIBarButtonItem(title: "登陆", style: .Plain, target: self, action: #selector(CCHomeTableViewController.tapLoginItem))
        
        return loginRightBarButtonItem
    }()
    
    func tapLoginItem() {
        print("tapLoginItem")
    }
}
